<%-- 
    Document   : class-of-student
    Created on : Feb 26, 2012, 8:02:59 PM
    Author     : PhucAn
--%>
<%@taglib  prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@include  file="../handler/class-of-student-action.jsp" %>
<script type="text/javascript">
    function select(idx){
        document.getElementById("selected-item-id").value= idx;
        document.forms[0].submit();
    }
</script>
<form action="#" method="post">
    <table class="data-table">
        <tr>
            <th>Class name</th>
            <th>Created date</th>                    
            <th>Teacher</th>
            <th></th>
        </tr>
        <c:forEach  var="cls" items="${list}">
            <tr>
                <td>${cls.name}</td>
                <td>${cls.createdDate}</td>                   
                <td></td>
                <td>                       
                    <a href="javascript:select(${cls.id})">Select</a>                        
                </td>                    
            </tr>
        </c:forEach>
    </table>
    <input type="hidden"  name="classid" id="selected-item-id"/>
</form>